<?php
/* @var $this ClientController */
/* @var $model Client */

$this->breadcrumbs=array(
	'Clients'=>array('index'),
	$model->name,
);



require_once 'Mobile_Detect.php';
	
	

			$detect = new Mobile_Detect;
			
if ($detect->isMobile() ){
?>

<body style="background-image: url( http://i59.tinypic.com/35i0i0z.png )"> </body>


<?php

$this->menu=array(
	array('label'=>'List Client', 'url'=>array('index')),
	array('label'=>'Manage Client', 'url'=>array('admin')),
);
 
 } 
 
 else
 {
 
$this->menu=array(
	array('label'=>'List Client', 'url'=>array('index')),
	array('label'=>'Create Client', 'url'=>array('create')),
	array('label'=>'Update Client', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete Client', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage Client', 'url'=>array('admin')),
);
 }
?>

<h1>View Client: <?php echo $model->name; ?></h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'name',
		'address',
		'mobile_no',
		'telephone_no',
		'email',
	),
)); ?>

<br>


		<?php $entry= Entry::model()->findAll('client_id = :a', array(':a'=>$model->id));?>
		<?php if (count($entry) !== 0){
		$i = 0;
		?>

		<h1>View Entries:</h1>
<br>
			
		<?php foreach ($entry as $row) 
	{ ?>
	<h4>
	<?php
		$i++; echo $i . '.'. CHtml::link($row->code, array('entry/view', 'id'=>$row->id));?>
		
		
		</h4>
		<br>
		<?php

		 $this->widget('zii.widgets.CDetailView', array(
	'data'=>$row,
	'attributes'=>array(
		//'id',
		//'code',
		

	),
)); 
		
		}}
		?>
